var basesUrl = 'http://47.108.197.28:3000'
function http(url){
    return new Promise((resolve,reject)=>{
        wx.request({
            url:basesUrl+url,
            method:"GET",
            dataType:"json",
            responseType:"text",
            success:(res)=>{
              resolve(res)
            },
            error:(err)=>{
              reject(err)
            }
          })
    })
}
function getIndexHttp(offset){
  return http(`/top/playlist?offset=${offset}&limit=20`)
}

function getMusicHttp(limit){
  return http(`/top/album?limit=${limit}`)
}
module.exports = {
  getIndexHttp,
  getMusicHttp
}